<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        function $$(id) {
            return document.getElementById(id);
        }
        window.onload = function () {
            var cnv = $$("canvas");
            var cxt = cnv.getContext("2d");
            cxt.beginPath();
            // 记住使用的是W3C坐标系
            // 可以把anticlockwise设置为false看看效果
            cxt.arc(70, 70, 50, 0, -90 * Math.PI / 180, true);
            cxt.closePath();
            cxt.strokeStyle = "HotPink";
            cxt.stroke();
        }
    </script>
</head>

<body><canvas id="canvas" width="200" height="150" style="border:1px dashed gray;"></canvas></body>

</html>